{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "from minepy import MINE\n",
    "from joblib  import Parallel,delayed\n",
    "import numpy as np\n",
    "import os\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "file_names = [file for file in os.listdir('./basic_pred/') if file[0]!='.']\n",
    "file_names = sorted(file_names,key=lambda x:int(x.split('.')[0][3:]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "index = [0,1,3,11,16,17,21,24,26,30,32]\n",
    "pred = pd.DataFrame()\n",
    "pred_0 = pd.read_csv(os.path.join('./basic_pred/',file_names[0]))\n",
    "pred['id'] = pred_0.id\n",
    "pred_prob = pred_0.score\n",
    "for idx in index:\n",
    "    pred_tmp = pd.read_csv(os.path.join('./basic_pred/',file_names[idx]))\n",
    "    pred_prob+=pred_tmp.score\n",
    "pred['prob'] = pred_prob.values\n",
    "pred.to_csv('xgbtest1_pred.txt',index=False) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 0.83046852887673"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
